home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / sendmail / UCB / sendmail.8.6.3.patch.Z / sendmail.8.6.3.patch
Encoding:
Text File  |  1993-10-23  |  49.6 KB  |  2,011 lines

  1. Apply this patch to update an 8.6.2 sendmail to 8.6.3.
  2.  
  3. THIS IS A CRITICAL PATCH!  There were at least two bugs in 8.6.2 that
  4. caused problems on some jobs; these certainly included core dumps and
  5. duplicated mail delivery, and possibly lost mail.
  6.  
  7. *** RELEASE_NOTES.OLD    Sun Oct 17 12:01:28 1993
  8. --- RELEASE_NOTES    Sun Oct 24 11:18:10 1993
  9. ***************
  10. *** 1,3 ****
  11. --- 1,79 ----
  12. + 8.6.3/8.6.3    93/10/24
  13. +     IMPORTANT FIX: Fix several problems that caused open files to
  14. +         be "lost" during queue runs; this overflowed the open
  15. +         file table on large runs.  An assumption that fdopen
  16. +         always succeeds sometimes resulted in core dumps when
  17. +         this happens; sometimes the message is delivered twice,
  18. +         sometimes (probably) infinite times.  This problem in
  19. +         various form was reported by P{r (Pell) Emanuelsson and
  20. +         Robert Campbell of U.C. Berkeley.
  21. +     Special diagnosis of EMFILE error conditions -- it now prints
  22. +         the known open file descriptors so you can figure out
  23. +         what is consuming so much resources.
  24. +     Fix a couple of problems caused by early address parsing
  25. +         errors -- one caused it to return a "this is only a
  26. +         warning" when it really wasn't, and the other started
  27. +         parsing through a random pointer.  The first was
  28. +         noted by Eric Wassenaar.
  29. +     Fix an infinite loop problem caused by null components in the
  30. +         host signature.  Problem noted by Jan Sorensen.
  31. +     Be sure to reset the "current date" when sending an error
  32. +         message -- PostMasterCopy messages were being sent
  33. +         with an old Date: header.
  34. +     Fix a problem that caused duplicated mail when sendmail was
  35. +         (1) compiled without HASFLOCK, (2) you are sending to
  36. +         an alias that has an owner-* alias, (3) you execute
  37. +         sendmail with -t flag, (4) you run in -odb mode, and
  38. +         (5) the sender specifies both the alias name and
  39. +         another alias [i.e., the envelope is split], then
  40. +         duplicate messages are sent.  The problem description
  41. +         and one-line fix are from Motonori Nakamura of Kyoto
  42. +         University.
  43. +     Avoid a problem that causes error messages to be discarded
  44. +         in some cases -- this was the result of a "fix" to
  45. +         avoid duplicate error messages, but two are better
  46. +         than zero.  Reported by Tim Rylance.
  47. +     Fix a minor botch in checkfd012() -- fix from Dave Hill of
  48. +         Computervision R&D Ltd.
  49. +     Remove "X-Authentication-Warning: <user> set sender to <address>
  50. +         using -f" entirely -- it is far too eager to include
  51. +         this, and it is confusing folks.  I'll try to make it
  52. +         work "right" in 8.7.  Problem noted by Yoshitaka
  53. +         Tokugawa of dit Co., Ltd.
  54. +     Fix a race condition with the errno value in tick() and
  55. +         reapchild() -- this caused occasional misdiagnosis
  56. +         of problems.  Kyle Jones of UUNET helped this along.
  57. +     Repair rule loop-detection code.  From Michael Corrigan of
  58. +         U.C. San Diego.
  59. +     Fix a problem that caused sender domain addition (C mailer
  60. +         flag to be ignored if you use -odq or use -odb with
  61. +         a high load average.  Problem reported by Jim Murray
  62. +         of Stratus.
  63. +     Fix ident protocol on multi-homed machines.  It was not
  64. +         always using the correct interface.  Fix from J.R.
  65. +         Oldroyd of Opal.
  66. +     Previously, sendmail assumed that any SMTP greeting message
  67. +         that wasn't 2xx was a temporary failure -- it should
  68. +         only take 4xx as a temporary failure, and return a
  69. +         solid error message on anything else -- for example,
  70. +         to allow you to reject connections on a workstation
  71. +         that is MXed to a mail server.
  72. +     Portability enhancements for 386BSD/FreeBSD/NetBSD from
  73. +         Ollivier Robert.
  74. +     CONFIG: FEATURE(always_add_domain) didn't always add the domain;
  75. +         in particular, on local mail it modified the header sender
  76. +         but not the header recipient address(es).  Reported by
  77. +         Jeffrey Honig of Cornell University.  Also, strip
  78. +         any host from envelope recipient address(es), since
  79. +         local mailers don't understand host names -- this is
  80. +         to help mailertable entries.  From Christopher Davis.
  81. +     CONFIG: masquerading didn't apply to addresses that already
  82. +         had a domain.  This change replaces a local hostname
  83. +         by the masquerade name in the SMTP mailer (previously
  84. +         it only added the masquerade name if it didn't already
  85. +         have a domain name).  Several people complained about
  86. +         this.
  87.   8.6.2/8.6.2    93/10/15
  88.       Put a "successful delivery" message in the transcript for
  89.           addresses that get return-receipts.
  90. *** KNOWNBUGS.OLD    Sat Oct 23 16:43:19 1993
  91. --- KNOWNBUGS    Sun Oct 24 10:39:02 1993
  92. ***************
  93. *** 1,7 ****
  94.   
  95.   
  96.            K N O W N   B U G S   I N   S E N D M A I L
  97. !                  (for 8.6)
  98.   
  99.   
  100.   The following are bugs or deficiencies in sendmail that I am aware of
  101. --- 1,7 ----
  102.   
  103.   
  104.            K N O W N   B U G S   I N   S E N D M A I L
  105. !                  (for 8.6.3)
  106.   
  107.   
  108.   The following are bugs or deficiencies in sendmail that I am aware of
  109. ***************
  110. *** 37,53 ****
  111.     Sometimes identical, duplicate error messages can be generated.  As
  112.     near as I can tell, this is rare and relatively innocuous.
  113.   
  114.   * If you EXPN a list or user that has a program mailer, the output of
  115.     EXPN will include ``@local.host.name''.  You can't actually mail to
  116.     this address.  It's not clear what the right behaviour is in this
  117.     circumstance.
  118.   
  119. ! * You can't use a ``mailer:relay.host'' for UUCP_RELAY or the relay
  120. !   host in the SITECONFIG macro (the second argument) in the
  121. !   configurations.  If the goal is to use ESMTP instead of SMTP,
  122. !   define `confRELAY_MAILER' to `esmtp' and use no mailer name.  Note
  123. !   that the default mailer used for relays (`relay') does use ESMTP
  124. !   by default (it didn't in prior releases).  This problem does not
  125. !   occur for other relays (BITNET or CSNET) or mailertable entries.
  126. ! (Version 8.7, last updated 10/8/93)
  127. --- 37,51 ----
  128.     Sometimes identical, duplicate error messages can be generated.  As
  129.     near as I can tell, this is rare and relatively innocuous.
  130.   
  131. + * No "exposed users" in "nullrelay" configuration.
  132. +   The "nullrelay" configuration hides all addresses behind the mail
  133. +   hub name.  Some sites might prefer to expose some names such as
  134. +   root.  This information is always available in Received: lines.
  135.   * If you EXPN a list or user that has a program mailer, the output of
  136.     EXPN will include ``@local.host.name''.  You can't actually mail to
  137.     this address.  It's not clear what the right behaviour is in this
  138.     circumstance.
  139.   
  140. ! (Version 8.8, last updated 10/24/93)
  141. *** src/Makefile.OSF1.OLD    Wed Oct 20 08:14:13 1993
  142. --- src/Makefile.OSF1    Wed Oct 20 08:16:23 1993
  143. ***************
  144. *** 47,53 ****
  145.   OBJADD=
  146.   
  147.   # additional link flags
  148. ! LDADD=
  149.   
  150.   ###################  end of user configuration flags  ######################
  151.   
  152. --- 47,53 ----
  153.   OBJADD=
  154.   
  155.   # additional link flags
  156. ! LDADD=    -non_shared
  157.   
  158.   ###################  end of user configuration flags  ######################
  159.   
  160. ***************
  161. *** 85,93 ****
  162.   install-sendmail: sendmail
  163.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  164.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  165. !     install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \
  166. !         ${STDIR}/sendmail.st
  167. !     install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  168.   
  169.   # doesn't actually install them -- you may want to install pre-nroff versions
  170.   install-docs: aliases.0 newaliases.0 sendmail.0
  171. --- 85,94 ----
  172.   install-sendmail: sendmail
  173.       install -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
  174.       for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
  175. !     cp /dev/null ${STDIR}/sendmail.st
  176. !     chmod ${BINMOD}.${BINGRP} ${STDIR}/sendmail.st
  177. !     installbsd -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
  178. !     rm -f /usr/sbin/smtpd
  179.   
  180.   # doesn't actually install them -- you may want to install pre-nroff versions
  181.   install-docs: aliases.0 newaliases.0 sendmail.0
  182. *** src/READ_ME.OLD    Wed Oct 20 08:26:46 1993
  183. --- src/READ_ME    Sun Oct 24 10:39:25 1993
  184. ***************
  185. *** 30,36 ****
  186.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  187.   # SUCH DAMAGE.
  188.   #
  189. ! #    @(#)READ_ME    8.29 (Berkeley) 10/15/93
  190.   #
  191.   
  192.   This directory contains the source files for sendmail.
  193. --- 30,36 ----
  194.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  195.   # SUCH DAMAGE.
  196.   #
  197. ! #    @(#)READ_ME    8.30 (Berkeley) 10/24/93
  198.   #
  199.   
  200.   This directory contains the source files for sendmail.
  201. ***************
  202. *** 298,304 ****
  203.       patch.
  204.   
  205.   OSF/1
  206. !     If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
  207.   
  208.   NeXT
  209.       If you are compiling on NeXT, you will have to create an empty
  210. --- 298,307 ----
  211.       patch.
  212.   
  213.   OSF/1
  214. !     If you are compiling on OSF/1 (DEC Alpha), you must use -lmld
  215. !     and -non_shared (otherwise it core dumps on startup).  Also,
  216. !     the enclosed makefile removed /usr/sbin/smtpd; if you need it,
  217. !     just create the link to the sendmail binary.
  218.   
  219.   NeXT
  220.       If you are compiling on NeXT, you will have to create an empty
  221. ***************
  222. *** 480,483 ****
  223.   
  224.   Eric Allman
  225.   
  226. ! (Version 8.29, last update 10/15/93 08:34:06)
  227. --- 483,486 ----
  228.   
  229.   Eric Allman
  230.   
  231. ! (Version 8.30, last update 10/24/93 10:39:02)
  232. *** src/clock.c.OLD    Thu Oct 21 07:46:17 1993
  233. --- src/clock.c    Thu Oct 21 12:28:19 1993
  234. ***************
  235. *** 33,39 ****
  236.    */
  237.   
  238.   #ifndef lint
  239. ! static char sccsid[] = "@(#)clock.c    8.6 (Berkeley) 9/29/93";
  240.   #endif /* not lint */
  241.   
  242.   # include "sendmail.h"
  243. --- 33,39 ----
  244.    */
  245.   
  246.   #ifndef lint
  247. ! static char sccsid[] = "@(#)clock.c    8.7 (Berkeley) 10/21/93";
  248.   #endif /* not lint */
  249.   
  250.   # include "sendmail.h"
  251. ***************
  252. *** 166,171 ****
  253. --- 166,172 ----
  254.       register time_t now;
  255.       register EVENT *ev;
  256.       int mypid = getpid();
  257. +     int olderrno = errno;
  258.   #ifdef SIG_UNBLOCK
  259.       sigset_t ss;
  260.   #endif
  261. ***************
  262. *** 221,226 ****
  263. --- 222,228 ----
  264.   #endif /* SIG_UNBLOCK */
  265.   
  266.           /* call ev_func */
  267. +         errno = olderrno;
  268.           (*f)(arg);
  269.           (void) alarm(0);
  270.           now = curtime();
  271. ***************
  272. *** 228,233 ****
  273. --- 230,236 ----
  274.       (void) setsignal(SIGALRM, tick);
  275.       if (EventQueue != NULL)
  276.           (void) alarm((unsigned) (EventQueue->ev_time - now));
  277. +     errno = olderrno;
  278.   }
  279.    /*
  280.   **  SLEEP -- a version of sleep that works with this stuff
  281. *** src/conf.c.OLD    Thu Oct 21 07:50:21 1993
  282. --- src/conf.c    Thu Oct 21 12:28:19 1993
  283. ***************
  284. *** 33,39 ****
  285.    */
  286.   
  287.   #ifndef lint
  288. ! static char sccsid[] = "@(#)conf.c    8.41 (Berkeley) 10/15/93";
  289.   #endif /* not lint */
  290.   
  291.   # include "sendmail.h"
  292. --- 33,39 ----
  293.    */
  294.   
  295.   #ifndef lint
  296. ! static char sccsid[] = "@(#)conf.c    8.42 (Berkeley) 10/21/93";
  297.   #endif /* not lint */
  298.   
  299.   # include "sendmail.h"
  300. ***************
  301. *** 990,995 ****
  302. --- 990,996 ----
  303.   void
  304.   reapchild()
  305.   {
  306. +     int olderrno = errno;
  307.   # ifdef HASWAITPID
  308.       auto int status;
  309.       int count;
  310. ***************
  311. *** 1021,1026 ****
  312. --- 1022,1028 ----
  313.   # ifdef SYS5SIGNALS
  314.       (void) setsignal(SIGCHLD, reapchild);
  315.   # endif
  316. +     errno = olderrno;
  317.   }
  318.    /*
  319.   **  UNSETENV -- remove a variable from the environment
  320. *** src/conf.h.OLD    Sun Oct 17 18:23:09 1993
  321. --- src/conf.h    Thu Oct 21 07:19:39 1993
  322. ***************
  323. *** 31,37 ****
  324.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  325.    * SUCH DAMAGE.
  326.    *
  327. !  *    @(#)conf.h    8.38 (Berkeley) 10/15/93
  328.    */
  329.   
  330.   /*
  331. --- 31,37 ----
  332.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  333.    * SUCH DAMAGE.
  334.    *
  335. !  *    @(#)conf.h    8.42 (Berkeley) 10/21/93
  336.    */
  337.   
  338.   /*
  339. ***************
  340. *** 118,123 ****
  341. --- 118,125 ----
  342.   */
  343.   
  344.   # ifdef __hpux
  345. + /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
  346. + # undef m_flags
  347.   # define SYSTEM5    1    /* include all the System V defines */
  348.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  349.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  350. ***************
  351. *** 147,152 ****
  352. --- 149,155 ----
  353.   */
  354.   
  355.   # ifdef IRIX
  356. + # include <sys/sysmacros.h>
  357.   # define HASSETREUID    1    /* has setreuid(2) call */
  358.   # define HASINITGROUPS    1    /* has initgroups(3) call */
  359.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  360. ***************
  361. *** 171,176 ****
  362. --- 174,180 ----
  363.               /* Solaris 2.x (a.k.a. SunOS 5.x) */
  364.   #  define SYSTEM5    1    /* use System V definitions */
  365.   #  define setreuid(r, e)    seteuid(e)
  366. + #  include <sys/sysmacros.h>
  367.   #  include <sys/time.h>
  368.   #  define gethostbyname    __switch_gethostbyname    /* get working version */
  369.   #  define gethostbyaddr    __switch_gethostbyaddr    /* get working version */
  370. ***************
  371. *** 290,295 ****
  372. --- 294,317 ----
  373.   
  374.   
  375.   /*
  376. + **  386BSD / FreeBSD 1.0E (works) / NetBSD (not tested)
  377. + **
  378. + **  4.3BSD clone, closer to 4.4BSD
  379. + */
  380. + #ifdef __386BSD__
  381. + # define HASUNSETENV    1    /* has unsetenv(3) call */
  382. + # define HASSETSID    1    /* has the setsid(2) POSIX syscall */
  383. + # define HASSTATFS    1    /* has the statfs(2) syscall */
  384. + # include <sys/cdefs.h>
  385. + # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
  386. + # ifndef LA_TYPE
  387. + #  define LA_TYPE    LA_SUBR
  388. + # endif
  389. + #endif
  390. + /*
  391.   **  4.3 BSD -- this is for very old systems
  392.   **
  393.   **    You'll also have to install a new resolver library.
  394. ***************
  395. *** 398,403 ****
  396. --- 420,426 ----
  397.   */
  398.   
  399.   #ifdef _AUX_SOURCE
  400. + # include <sys/sysmacros.h>
  401.   # define BSD            /* has BSD routines */
  402.   # define HASSTATFS    1    /* has the statfs(2) syscall */
  403.   # define HASUNAME    1    /* use System V uname(2) system call */
  404. *** src/daemon.c.OLD    Sat Oct 16 08:25:43 1993
  405. --- src/daemon.c    Sat Oct 23 17:19:05 1993
  406. ***************
  407. *** 37,45 ****
  408.   
  409.   #ifndef lint
  410.   #ifdef DAEMON
  411. ! static char sccsid[] = "@(#)daemon.c    8.15 (Berkeley) 9/22/93 (with daemon mode)";
  412.   #else
  413. ! static char sccsid[] = "@(#)daemon.c    8.15 (Berkeley) 9/22/93 (without daemon mode)";
  414.   #endif
  415.   #endif /* not lint */
  416.   
  417. --- 37,45 ----
  418.   
  419.   #ifndef lint
  420.   #ifdef DAEMON
  421. ! static char sccsid[] = "@(#)daemon.c    8.19 (Berkeley) 10/23/93 (with daemon mode)";
  422.   #else
  423. ! static char sccsid[] = "@(#)daemon.c    8.19 (Berkeley) 10/23/93 (without daemon mode)";
  424.   #endif
  425.   #endif /* not lint */
  426.   
  427. ***************
  428. *** 315,322 ****
  429.   #endif
  430.   
  431.               (void) close(DaemonSocket);
  432. !             InChannel = fdopen(t, "r");
  433. !             OutChannel = fdopen(dup(t), "w");
  434.   
  435.               /* should we check for illegal connection here? XXX */
  436.   #ifdef XLA
  437. --- 315,327 ----
  438.   #endif
  439.   
  440.               (void) close(DaemonSocket);
  441. !             if ((InChannel = fdopen(t, "r")) == NULL ||
  442. !                 (t = dup(t)) < 0 ||
  443. !                 (OutChannel = fdopen(t, "w")) == NULL)
  444. !             {
  445. !                 syserr("cannot open SMTP server channel, fd=%d", t);
  446. !                 exit(0);
  447. !             }
  448.   
  449.               /* should we check for illegal connection here? XXX */
  450.   #ifdef XLA
  451. ***************
  452. *** 765,772 ****
  453.       }
  454.   
  455.       /* connection ok, put it into canonical form */
  456. !     mci->mci_out = fdopen(s, "w");
  457. !     mci->mci_in = fdopen(dup(s), "r");
  458.   
  459.       return (EX_OK);
  460.   }
  461. --- 770,782 ----
  462.       }
  463.   
  464.       /* connection ok, put it into canonical form */
  465. !     if ((mci->mci_out = fdopen(s, "w")) == NULL ||
  466. !         (s = dup(s)) < 0 ||
  467. !         (mci->mci_in = fdopen(s, "r")) == NULL)
  468. !     {
  469. !         syserr("cannot open SMTP client channel, fd=%d", s);
  470. !         return EX_TEMPFAIL;
  471. !     }
  472.   
  473.       return (EX_OK);
  474.   }
  475. ***************
  476. *** 896,902 ****
  477.           ntohs(fa.sin.sin_port), ntohs(la.sin.sin_port));
  478.   
  479.       /* create local address */
  480. !     bzero(&la, sizeof la);
  481.   
  482.       /* create foreign address */
  483.       sp = getservbyname("auth", "tcp");
  484. --- 906,912 ----
  485.           ntohs(fa.sin.sin_port), ntohs(la.sin.sin_port));
  486.   
  487.       /* create local address */
  488. !     la.sin.sin_port = 0;
  489.   
  490.       /* create foreign address */
  491.       sp = getservbyname("auth", "tcp");
  492. ***************
  493. *** 916,922 ****
  494.       /* put a timeout around the whole thing */
  495.       ev = setevent(TimeOuts.to_ident, authtimeout, 0);
  496.   
  497. !     /* connect to foreign IDENT server */
  498.       s = socket(AF_INET, SOCK_STREAM, 0);
  499.       if (s < 0)
  500.       {
  501. --- 926,932 ----
  502.       /* put a timeout around the whole thing */
  503.       ev = setevent(TimeOuts.to_ident, authtimeout, 0);
  504.   
  505. !     /* connect to foreign IDENT server using same address as SMTP socket */
  506.       s = socket(AF_INET, SOCK_STREAM, 0);
  507.       if (s < 0)
  508.       {
  509. ***************
  510. *** 923,929 ****
  511.           clrevent(ev);
  512.           goto noident;
  513.       }
  514. !     if (connect(s, &fa.sa, sizeof fa.sin) < 0)
  515.       {
  516.   closeident:
  517.           (void) close(s);
  518. --- 933,940 ----
  519.           clrevent(ev);
  520.           goto noident;
  521.       }
  522. !     if (bind(s, &la.sa, sizeof la.sin) < 0 ||
  523. !         connect(s, &fa.sa, sizeof fa.sin) < 0)
  524.       {
  525.   closeident:
  526.           (void) close(s);
  527. ***************
  528. *** 1177,1183 ****
  529.       register char *bp;
  530.       register char *ap;
  531.       int l;
  532. !     static char buf[80];
  533.   
  534.       /* check for null/zero family */
  535.       if (sap == NULL)
  536. --- 1188,1194 ----
  537.       register char *bp;
  538.       register char *ap;
  539.       int l;
  540. !     static char buf[100];
  541.   
  542.       /* check for null/zero family */
  543.       if (sap == NULL)
  544. ***************
  545. *** 1185,1195 ****
  546.       if (sap->sa.sa_family == 0)
  547.           return "0";
  548.   
  549.   #ifdef NETINET
  550. !     if (sap->sa.sa_family == AF_INET)
  551.           return inet_ntoa(((struct sockaddr_in *) sap)->sin_addr);
  552.   #endif
  553.   
  554.       /* unknown family -- just dump bytes */
  555.       (void) sprintf(buf, "Family %d: ", sap->sa.sa_family);
  556.       bp = &buf[strlen(buf)];
  557. --- 1196,1222 ----
  558.       if (sap->sa.sa_family == 0)
  559.           return "0";
  560.   
  561. +     switch (sap->sa.sa_family)
  562. +     {
  563. + #ifdef MAYBENEXTRELEASE        /*** UNTESTED *** UNTESTED *** UNTESTED ***/
  564. +       case AF_UNIX:
  565. +           if (sap->sun.sun_path[0] != '\0')
  566. +               sprintf(buf, "[UNIX: %.64s]", sap->sun.sun_path);
  567. +           else
  568. +               sprintf(buf, "[UNIX: localhost]");
  569. +         return buf;
  570. + #endif
  571.   #ifdef NETINET
  572. !       case AF_INET:
  573.           return inet_ntoa(((struct sockaddr_in *) sap)->sin_addr);
  574.   #endif
  575.   
  576. +       default:
  577. +           /* this case is only to ensure syntactic correctness */
  578. +           break;
  579. +     }
  580.       /* unknown family -- just dump bytes */
  581.       (void) sprintf(buf, "Family %d: ", sap->sa.sa_family);
  582.       bp = &buf[strlen(buf)];
  583. ***************
  584. *** 1220,1229 ****
  585.       register SOCKADDR *sap;
  586.   {
  587.       register struct hostent *hp;
  588. - #ifdef NAMED_BIND
  589.       int saveretry;
  590.   
  591.       /* shorten name server timeout to avoid higher level timeouts */
  592.       saveretry = _res.retry;
  593.       _res.retry = 3;
  594. --- 1247,1255 ----
  595.       register SOCKADDR *sap;
  596.   {
  597.       register struct hostent *hp;
  598.       int saveretry;
  599.   
  600. + #ifdef NAMED_BIND
  601.       /* shorten name server timeout to avoid higher level timeouts */
  602.       saveretry = _res.retry;
  603.       _res.retry = 3;
  604. ***************
  605. *** 1244,1249 ****
  606. --- 1270,1281 ----
  607.           hp = gethostbyaddr((char *) &sap->siso.siso_addr,
  608.               sizeof sap->siso.siso_addr,
  609.               AF_ISO);
  610. +         break;
  611. + #endif
  612. + #ifdef MAYBENEXTRELEASE        /*** UNTESTED *** UNTESTED *** UNTESTED ***/
  613. +       case AF_UNIX:
  614. +         hp = NULL;
  615.           break;
  616.   #endif
  617.   
  618. *** src/deliver.c.OLD    Sat Oct 16 08:25:43 1993
  619. --- src/deliver.c    Sat Oct 23 12:46:37 1993
  620. ***************
  621. *** 33,39 ****
  622.    */
  623.   
  624.   #ifndef lint
  625. ! static char sccsid[] = "@(#)deliver.c    8.31 (Berkeley) 10/15/93";
  626.   #endif /* not lint */
  627.   
  628.   #include "sendmail.h"
  629. --- 33,39 ----
  630.    */
  631.   
  632.   #ifndef lint
  633. ! static char sccsid[] = "@(#)deliver.c    8.36 (Berkeley) 10/23/93";
  634.   #endif /* not lint */
  635.   
  636.   #include "sendmail.h"
  637. ***************
  638. *** 236,242 ****
  639.               ee->e_from.q_flags |= QDONTSEND;
  640.               ee->e_dfp = NULL;
  641.               ee->e_xfp = NULL;
  642. -             ee->e_lockfp = NULL;
  643.               ee->e_df = NULL;
  644.               ee->e_errormode = EM_MAIL;
  645.               ee->e_sibling = splitenv;
  646. --- 236,241 ----
  647. ***************
  648. *** 369,375 ****
  649.   
  650.           /* now drop the envelope in the parent */
  651.           e->e_flags |= EF_INQUEUE|EF_KEEPQUEUE;
  652. -         e->e_flags &= ~EF_FATALERRS;
  653.           dropenvelope(e);
  654.   
  655.           /* and reacquire in the child */
  656. --- 368,373 ----
  657. ***************
  658. *** 591,597 ****
  659.       char buf[MAXNAME];
  660.       char rpathbuf[MAXNAME];        /* translated return path */
  661.       extern int checkcompat();
  662. -     extern FILE *fdopen();
  663.       extern char SmtpError[];
  664.   
  665.       errno = 0;
  666. --- 589,594 ----
  667. ***************
  668. *** 615,620 ****
  669. --- 612,619 ----
  670.       if (tTd(10, 1))
  671.           printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n",
  672.               m->m_mno, host, to->q_user);
  673. +     if (tTd(10, 100))
  674. +         printopenfds(FALSE);
  675.   
  676.       /*
  677.       **  If this mailer is expensive, and if we don't want to make
  678. ***************
  679. *** 993,998 ****
  680. --- 992,998 ----
  681.               if (p == curhost)
  682.               {
  683.                   syserr("deliver: null host name in signature");
  684. +                 curhost++;
  685.                   continue;
  686.               }
  687.               strncpy(hostbuf, curhost, p - curhost);
  688. ***************
  689. *** 1009,1015 ****
  690.                   if (tTd(11, 1))
  691.                   {
  692.                       printf("openmailer: ");
  693. !                     mci_dump(mci);
  694.                   }
  695.                   CurHostName = mci->mci_host;
  696.                   break;
  697. --- 1009,1015 ----
  698.                   if (tTd(11, 1))
  699.                   {
  700.                       printf("openmailer: ");
  701. !                     mci_dump(mci, FALSE);
  702.                   }
  703.                   CurHostName = mci->mci_host;
  704.                   break;
  705. ***************
  706. *** 1145,1153 ****
  707.               (void) setsignal(SIGHUP, SIG_IGN);
  708.               (void) setsignal(SIGTERM, SIG_DFL);
  709.   
  710. -             /* close any other cached connections */
  711. -             mci_flush(FALSE, mci);
  712.               /* reset user and group */
  713.               if (!bitnset(M_RESTR, m->m_flags))
  714.               {
  715. --- 1145,1150 ----
  716. ***************
  717. *** 1270,1279 ****
  718. --- 1267,1299 ----
  719.           mci->mci_pid = pid;
  720.           (void) close(mpvect[0]);
  721.           mci->mci_out = fdopen(mpvect[1], "w");
  722. +         if (mci->mci_out == NULL)
  723. +         {
  724. +             syserr("deliver: cannot create mailer output channel, fd=%d",
  725. +                 mpvect[1]);
  726. +             (void) close(mpvect[1]);
  727. +             if (clever)
  728. +             {
  729. +                 (void) close(rpvect[0]);
  730. +                 (void) close(rpvect[1]);
  731. +             }
  732. +             rcode = EX_OSERR;
  733. +             goto give_up;
  734. +         }
  735.           if (clever)
  736.           {
  737.               (void) close(rpvect[1]);
  738.               mci->mci_in = fdopen(rpvect[0], "r");
  739. +             if (mci->mci_in == NULL)
  740. +             {
  741. +                 syserr("deliver: cannot create mailer input channel, fd=%d",
  742. +                     mpvect[1]);
  743. +                 (void) close(rpvect[0]);
  744. +                 fclose(mci->mci_out);
  745. +                 mci->mci_out = NULL;
  746. +                 rcode = EX_OSERR;
  747. +                 goto give_up;
  748. +             }
  749.           }
  750.           else
  751.           {
  752. ***************
  753. *** 1293,1299 ****
  754.       if (tTd(11, 1))
  755.       {
  756.           printf("openmailer: ");
  757. !         mci_dump(mci);
  758.       }
  759.   
  760.       if (mci->mci_state != MCIS_OPEN)
  761. --- 1313,1319 ----
  762.       if (tTd(11, 1))
  763.       {
  764.           printf("openmailer: ");
  765. !         mci_dump(mci, FALSE);
  766.       }
  767.   
  768.       if (mci->mci_state != MCIS_OPEN)
  769. *** src/envelope.c.OLD    Sat Oct 16 08:25:43 1993
  770. --- src/envelope.c    Sat Oct 23 12:45:36 1993
  771. ***************
  772. *** 33,39 ****
  773.    */
  774.   
  775.   #ifndef lint
  776. ! static char sccsid[] = "@(#)envelope.c    8.11 (Berkeley) 9/4/93";
  777.   #endif /* not lint */
  778.   
  779.   #include "sendmail.h"
  780. --- 33,39 ----
  781.    */
  782.   
  783.   #ifndef lint
  784. ! static char sccsid[] = "@(#)envelope.c    8.13 (Berkeley) 10/23/93";
  785.   #endif /* not lint */
  786.   
  787.   #include "sendmail.h"
  788. ***************
  789. *** 135,140 ****
  790. --- 135,141 ----
  791.       **  Extract state information from dregs of send list.
  792.       */
  793.   
  794. +     e->e_flags &= ~EF_QUEUERUN;
  795.       for (q = e->e_sendqueue; q != NULL; q = q->q_next)
  796.       {
  797.           if (bitset(QQUEUEUP, q->q_flags))
  798. ***************
  799. *** 488,493 ****
  800. --- 489,503 ----
  801.               syserr("!Can't open /dev/null");
  802.       }
  803.       e->e_xfp = fdopen(fd, "w");
  804. +     if (e->e_xfp == NULL)
  805. +     {
  806. +         syserr("!Can't create transcript stream %s", p);
  807. +     }
  808. +     if (tTd(46, 9))
  809. +     {
  810. +         printf("openxscript(%s):\n  ", p);
  811. +         dumpfd(fileno(e->e_xfp), TRUE, FALSE);
  812. +     }
  813.   }
  814.    /*
  815.   **  CLOSEXSCRIPT -- close the transcript file.
  816. *** src/err.c.OLD    Sun Oct 17 09:53:40 1993
  817. --- src/err.c    Thu Oct 21 07:18:59 1993
  818. ***************
  819. *** 33,39 ****
  820.    */
  821.   
  822.   #ifndef lint
  823. ! static char sccsid[] = "@(#)err.c    8.10 (Berkeley) 10/3/93";
  824.   #endif /* not lint */
  825.   
  826.   # include "sendmail.h"
  827. --- 33,39 ----
  828.    */
  829.   
  830.   #ifndef lint
  831. ! static char sccsid[] = "@(#)err.c    8.12 (Berkeley) 10/21/93";
  832.   #endif /* not lint */
  833.   
  834.   # include "sendmail.h"
  835. ***************
  836. *** 116,121 ****
  837. --- 116,126 ----
  838.               CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id,
  839.               &MsgBuf[4]);
  840.   # endif /* LOG */
  841. +     if (olderrno == EMFILE)
  842. +     {
  843. +         printopenfds(TRUE);
  844. +         mci_dump_all(TRUE);
  845. +     }
  846.       if (panic)
  847.       {
  848.   #ifdef XLA
  849. *** src/headers.c.OLD    Sun Oct 24 08:11:14 1993
  850. --- src/headers.c    Sun Oct 24 10:34:35 1993
  851. ***************
  852. *** 33,39 ****
  853.    */
  854.   
  855.   #ifndef lint
  856. ! static char sccsid[] = "@(#)headers.c    8.12 (Berkeley) 9/26/93";
  857.   #endif /* not lint */
  858.   
  859.   # include <errno.h>
  860. --- 33,39 ----
  861.    */
  862.   
  863.   #ifndef lint
  864. ! static char sccsid[] = "@(#)headers.c    8.13 (Berkeley) 10/24/93";
  865.   #endif /* not lint */
  866.   
  867.   # include <errno.h>
  868. ***************
  869. *** 713,721 ****
  870.               gotangle = TRUE;
  871.   
  872.               /* oops -- have to change our mind */
  873. !             anglelev++;
  874.               if (!skipping)
  875. !                 realanglelev++;
  876.   
  877.               bp = buf;
  878.               if (quoteit)
  879. --- 713,721 ----
  880.               gotangle = TRUE;
  881.   
  882.               /* oops -- have to change our mind */
  883. !             anglelev = 1;
  884.               if (!skipping)
  885. !                 realanglelev = 1;
  886.   
  887.               bp = buf;
  888.               if (quoteit)
  889. ***************
  890. *** 772,777 ****
  891. --- 772,778 ----
  892.                   /* syntax error: unmatched > */
  893.                   if (copylev > 0)
  894.                       bp--;
  895. +                 quoteit = TRUE;
  896.                   continue;
  897.               }
  898.               if (copylev++ <= 0)
  899. *** src/main.c.OLD    Thu Oct 21 06:39:27 1993
  900. --- src/main.c    Sun Oct 24 10:34:05 1993
  901. ***************
  902. *** 39,45 ****
  903.   #endif /* not lint */
  904.   
  905.   #ifndef lint
  906. ! static char sccsid[] = "@(#)main.c    8.30 (Berkeley) 10/15/93";
  907.   #endif /* not lint */
  908.   
  909.   #define    _DEFINE
  910. --- 39,45 ----
  911.   #endif /* not lint */
  912.   
  913.   #ifndef lint
  914. ! static char sccsid[] = "@(#)main.c    8.33 (Berkeley) 10/24/93";
  915.   #endif /* not lint */
  916.   
  917.   #define    _DEFINE
  918. ***************
  919. *** 624,632 ****
  920. --- 624,634 ----
  921.       if (warn_C_flag)
  922.           auth_warning(CurEnv, "Processed by %s with -C %s",
  923.               RealUserName, ConfFile);
  924. + /*
  925.       if (warn_f_flag != '\0')
  926.           auth_warning(CurEnv, "%s set sender to %s using -%c",
  927.               RealUserName, from, warn_f_flag);
  928. + */
  929.       if (Warn_Q_option)
  930.           auth_warning(CurEnv, "Processed from queue %s", QueueDir);
  931.   
  932. ***************
  933. *** 857,862 ****
  934. --- 859,865 ----
  935.               char *q;
  936.               auto char *delimptr;
  937.               extern bool invalidaddr();
  938. +             extern char *crackaddr();
  939.   
  940.               if (Verbose)
  941.                   printf("> ");
  942. ***************
  943. *** 865,872 ****
  944.                   finis();
  945.               if (!Verbose)
  946.                   printf("> %s", buf);
  947. !             if (buf[0] == '#')
  948.                   continue;
  949.               for (p = buf; isascii(*p) && isspace(*p); p++)
  950.                   continue;
  951.               q = p;
  952. --- 868,887 ----
  953.                   finis();
  954.               if (!Verbose)
  955.                   printf("> %s", buf);
  956. !             switch (buf[0])
  957. !             {
  958. !               case '#':
  959.                   continue;
  960. + #ifdef MAYBENEXTRELEASE
  961. +               case 'C':        /* try crackaddr */
  962. +                   q = crackaddr(&buf[1]);
  963. +                   xputs(q);
  964. +                   printf("\n");
  965. +                   continue;
  966. + #endif
  967. +             }
  968.               for (p = buf; isascii(*p) && isspace(*p); p++)
  969.                   continue;
  970.               q = p;
  971. ***************
  972. *** 878,884 ****
  973.                   continue;
  974.               }
  975.               *p = '\0';
  976. !             if (invalidaddr(p + 1))
  977.                   continue;
  978.               do
  979.               {
  980. --- 893,899 ----
  981.                   continue;
  982.               }
  983.               *p = '\0';
  984. !             if (invalidaddr(p + 1, NULL))
  985.                   continue;
  986.               do
  987.               {
  988. ***************
  989. *** 1090,1095 ****
  990. --- 1105,1112 ----
  991.           printf("\n====finis: stat %d e_flags %o, e_id=%s\n",
  992.               ExitStat, CurEnv->e_flags,
  993.               CurEnv->e_id == NULL ? "NOQUEUE" : CurEnv->e_id);
  994. +     if (tTd(2, 9))
  995. +         printopenfds(FALSE);
  996.   
  997.       /* clean up temp files */
  998.       CurEnv->e_to = NULL;
  999. *** src/mci.c.OLD    Wed Oct 20 09:43:01 1993
  1000. --- src/mci.c    Sat Oct 23 11:56:32 1993
  1001. ***************
  1002. *** 33,39 ****
  1003.    */
  1004.   
  1005.   #ifndef lint
  1006. ! static char sccsid[] = "@(#)mci.c    8.3 (Berkeley) 7/19/93";
  1007.   #endif /* not lint */
  1008.   
  1009.   #include "sendmail.h"
  1010. --- 33,39 ----
  1011.    */
  1012.   
  1013.   #ifndef lint
  1014. ! static char sccsid[] = "@(#)mci.c    8.6 (Berkeley) 10/23/93";
  1015.   #endif /* not lint */
  1016.   
  1017.   #include "sendmail.h"
  1018. ***************
  1019. *** 104,109 ****
  1020. --- 104,119 ----
  1021.       if (*mcislot != NULL)
  1022.           mci_uncache(mcislot, TRUE);
  1023.   
  1024. +     if (tTd(42, 5))
  1025. +         printf("mci_cache: caching %x (%s) in slot %d\n",
  1026. +             mci, mci->mci_host, mcislot - MciCache);
  1027. + #ifdef LOG
  1028. +     if (tTd(91, 100))
  1029. +         syslog(LOG_DEBUG, "%s: mci_cache: caching %x (%s) in slot %d",
  1030. +             CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
  1031. +             mci, mci->mci_host, mcislot - MciCache);
  1032. + #endif
  1033.       *mcislot = mci;
  1034.       mci->mci_flags |= MCIF_CACHED;
  1035.   }
  1036. ***************
  1037. *** 185,190 ****
  1038. --- 195,210 ----
  1039.           return;
  1040.       *mcislot = NULL;
  1041.   
  1042. +     if (tTd(42, 5))
  1043. +         printf("mci_uncache: uncaching %x (%s) from slot %d (%d)\n",
  1044. +             mci, mci->mci_host, mcislot - MciCache, doquit);
  1045. + #ifdef LOG
  1046. +     if (tTd(91, 100))
  1047. +         syslog(LOG_DEBUG, "%s: mci_uncache: uncaching %x (%s) from slot %d (%d)",
  1048. +             CurEnv->e_id ? CurEnv->e_id : "NOQUEUE",
  1049. +             mci, mci->mci_host, mcislot - MciCache, doquit);
  1050. + #endif
  1051.       if (doquit)
  1052.       {
  1053.           message("Closing connection to %s", mci->mci_host);
  1054. ***************
  1055. *** 295,319 ****
  1056.   **        none.
  1057.   */
  1058.   
  1059. ! mci_dump(mci)
  1060.       register MCI *mci;
  1061.   {
  1062.       extern char *ctime();
  1063.   
  1064. !     printf("MCI@%x: ", mci);
  1065.       if (mci == NULL)
  1066.       {
  1067. !         printf("NULL\n");
  1068. !         return;
  1069.       }
  1070. !     printf("flags=%o, errno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,\n",
  1071.           mci->mci_flags, mci->mci_errno, mci->mci_herrno,
  1072. !         mci->mci_exitstat, mci->mci_state, mci->mci_pid);
  1073. !     printf("\tmaxsize=%ld, phase=%s, mailer=%s,\n",
  1074.           mci->mci_maxsize,
  1075.           mci->mci_phase == NULL ? "NULL" : mci->mci_phase,
  1076. !         mci->mci_mailer == NULL ? "NULL" : mci->mci_mailer->m_name);
  1077. !     printf("\thost=%s, lastuse=%s\n",
  1078.           mci->mci_host == NULL ? "NULL" : mci->mci_host,
  1079.           ctime(&mci->mci_lastuse));
  1080.   }
  1081. --- 315,373 ----
  1082.   **        none.
  1083.   */
  1084.   
  1085. ! mci_dump(mci, logit)
  1086.       register MCI *mci;
  1087. +     bool logit;
  1088.   {
  1089. +     register char *p;
  1090. +     char *sep;
  1091. +     char buf[1000];
  1092.       extern char *ctime();
  1093.   
  1094. !     sep = logit ? " " : "\n\t";
  1095. !     p = buf;
  1096. !     sprintf(p, "MCI@%x: ", mci);
  1097. !     p += strlen(p);
  1098.       if (mci == NULL)
  1099.       {
  1100. !         sprintf(p, "NULL");
  1101. !         goto printit;
  1102.       }
  1103. !     sprintf(p, "flags=%o, errno=%d, herrno=%d, exitstat=%d, state=%d, pid=%d,%s",
  1104.           mci->mci_flags, mci->mci_errno, mci->mci_herrno,
  1105. !         mci->mci_exitstat, mci->mci_state, mci->mci_pid, sep);
  1106. !     p += strlen(p);
  1107. !     sprintf(p, "maxsize=%ld, phase=%s, mailer=%s,%s",
  1108.           mci->mci_maxsize,
  1109.           mci->mci_phase == NULL ? "NULL" : mci->mci_phase,
  1110. !         mci->mci_mailer == NULL ? "NULL" : mci->mci_mailer->m_name,
  1111. !         sep);
  1112. !     p += strlen(p);
  1113. !     sprintf(p, "host=%s, lastuse=%s",
  1114.           mci->mci_host == NULL ? "NULL" : mci->mci_host,
  1115.           ctime(&mci->mci_lastuse));
  1116. + printit:
  1117. +     if (logit)
  1118. +         syslog(LOG_INFO, "%s", buf);
  1119. +     else
  1120. +         printf("%s\n", buf);
  1121. + }
  1122. +  /*
  1123. + **  MCI_DUMP_ALL -- print the entire MCI cache
  1124. + **
  1125. + **    Parameters:
  1126. + **        logit -- if set, log the result instead of printing
  1127. + **            to stdout.
  1128. + **
  1129. + **    Returns:
  1130. + **        none.
  1131. + */
  1132. + mci_dump_all(logit)
  1133. +     bool logit;
  1134. + {
  1135. +     register int i;
  1136. +     for (i = 0; i < MaxMciCache; i++)
  1137. +         mci_dump(MciCache[i], logit);
  1138.   }
  1139. *** src/parseaddr.c.OLD    Sun Oct 17 11:59:06 1993
  1140. --- src/parseaddr.c    Fri Oct 22 09:21:59 1993
  1141. ***************
  1142. *** 33,39 ****
  1143.    */
  1144.   
  1145.   #ifndef lint
  1146. ! static char sccsid[] = "@(#)parseaddr.c    8.12 (Berkeley) 9/27/93";
  1147.   #endif /* not lint */
  1148.   
  1149.   # include "sendmail.h"
  1150. --- 33,39 ----
  1151.    */
  1152.   
  1153.   #ifndef lint
  1154. ! static char sccsid[] = "@(#)parseaddr.c    8.14 (Berkeley) 10/22/93";
  1155.   #endif /* not lint */
  1156.   
  1157.   # include "sendmail.h"
  1158. ***************
  1159. *** 100,112 ****
  1160.       if (tTd(20, 1))
  1161.           printf("\n--parseaddr(%s)\n", addr);
  1162.   
  1163. -     if (invalidaddr(addr))
  1164. -     {
  1165. -         if (tTd(20, 1))
  1166. -             printf("parseaddr-->bad address\n");
  1167. -         return NULL;
  1168. -     }
  1169.       if (delimptr == NULL)
  1170.           delimptr = &delimptrbuf;
  1171.   
  1172. --- 100,105 ----
  1173. ***************
  1174. *** 118,123 ****
  1175. --- 111,123 ----
  1176.           return (NULL);
  1177.       }
  1178.   
  1179. +     if (invalidaddr(addr, delim == '\0' ? NULL : *delimptr))
  1180. +     {
  1181. +         if (tTd(20, 1))
  1182. +             printf("parseaddr-->bad address\n");
  1183. +         return NULL;
  1184. +     }
  1185.       /*
  1186.       **  Save addr if we are going to have to.
  1187.       **
  1188. ***************
  1189. *** 204,221 ****
  1190.   */
  1191.   
  1192.   bool
  1193. ! invalidaddr(addr)
  1194.       register char *addr;
  1195.   {
  1196. !     for (; *addr != '\0'; addr++)
  1197.       {
  1198. !         if ((*addr & 0340) != 0200)
  1199. !             continue;
  1200. !         setstat(EX_USAGE);
  1201. !         usrerr("553 Address contained invalid control characters");
  1202.           return TRUE;
  1203.       }
  1204. !     return FALSE;
  1205.   }
  1206.    /*
  1207.   **  ALLOCADDR -- do local allocations of address on demand.
  1208. --- 204,239 ----
  1209.   */
  1210.   
  1211.   bool
  1212. ! invalidaddr(addr, delimptr)
  1213.       register char *addr;
  1214. +     char *delimptr;
  1215.   {
  1216. !     char savedelim;
  1217. !     if (delimptr != NULL)
  1218. !         savedelim = *delimptr;
  1219. ! #if 0
  1220. !     /* for testing.... */
  1221. !     if (strcmp(addr, "INvalidADDR") == 0)
  1222.       {
  1223. !         usrerr("553 INvalid ADDRess");
  1224. !         if (delimptr != NULL)
  1225. !             *delimptr = savedelim;
  1226.           return TRUE;
  1227.       }
  1228. ! #endif
  1229. !     for (; *addr != '\0'; addr++)
  1230. !     {
  1231. !         if ((*addr & 0340) == 0200)
  1232. !             break;
  1233. !     }
  1234. !     if (delimptr != NULL)
  1235. !         *delimptr = savedelim;
  1236. !     if (*addr == '\0')
  1237. !         return FALSE;
  1238. !     setstat(EX_USAGE);
  1239. !     usrerr("553 Address contained invalid control characters");
  1240. !     return TRUE;
  1241.   }
  1242.    /*
  1243.   **  ALLOCADDR -- do local allocations of address on demand.
  1244. ***************
  1245. *** 625,630 ****
  1246. --- 643,649 ----
  1247.       register struct rewrite *rwr;    /* pointer to current rewrite rule */
  1248.       int ruleno;            /* current rule number */
  1249.       int rstat = EX_OK;        /* return status */
  1250. +     int loopcount;
  1251.       struct match mlist[MAXMATCH];    /* stores match on LHS */
  1252.       char *npvp[MAXATOM+1];        /* temporary space for rebuild */
  1253.   
  1254. ***************
  1255. *** 647,656 ****
  1256.       */
  1257.   
  1258.       ruleno = 1;
  1259.       for (rwr = RewriteRules[ruleset]; rwr != NULL; )
  1260.       {
  1261. -         int loopcount = 0;
  1262.           if (tTd(21, 12))
  1263.           {
  1264.               printf("-----trying rule:");
  1265. --- 666,674 ----
  1266.       */
  1267.   
  1268.       ruleno = 1;
  1269. +     loopcount = 0;
  1270.       for (rwr = RewriteRules[ruleset]; rwr != NULL; )
  1271.       {
  1272.           if (tTd(21, 12))
  1273.           {
  1274.               printf("-----trying rule:");
  1275. ***************
  1276. *** 860,865 ****
  1277. --- 878,884 ----
  1278.                   printf("----- rule fails\n");
  1279.               rwr = rwr->r_next;
  1280.               ruleno++;
  1281. +             loopcount = 0;
  1282.               continue;
  1283.           }
  1284.   
  1285. ***************
  1286. *** 876,881 ****
  1287. --- 895,901 ----
  1288.               rvp++;
  1289.               rwr = rwr->r_next;
  1290.               ruleno++;
  1291. +             loopcount = 0;
  1292.           }
  1293.           else if ((*rp & 0377) == CANONHOST)
  1294.           {
  1295. *** src/queue.c.OLD    Sat Oct 16 08:25:43 1993
  1296. --- src/queue.c    Sat Oct 23 16:45:38 1993
  1297. ***************
  1298. *** 36,44 ****
  1299.   
  1300.   #ifndef lint
  1301.   #ifdef QUEUE
  1302. ! static char sccsid[] = "@(#)queue.c    8.20 (Berkeley) 10/8/93 (with queueing)";
  1303.   #else
  1304. ! static char sccsid[] = "@(#)queue.c    8.20 (Berkeley) 10/8/93 (without queueing)";
  1305.   #endif
  1306.   #endif /* not lint */
  1307.   
  1308. --- 36,44 ----
  1309.   
  1310.   #ifndef lint
  1311.   #ifdef QUEUE
  1312. ! static char sccsid[] = "@(#)queue.c    8.24 (Berkeley) 10/23/93 (with queueing)";
  1313.   #else
  1314. ! static char sccsid[] = "@(#)queue.c    8.24 (Berkeley) 10/23/93 (without queueing)";
  1315.   #endif
  1316.   #endif /* not lint */
  1317.   
  1318. ***************
  1319. *** 100,106 ****
  1320.       **  Create control file.
  1321.       */
  1322.   
  1323. !     newid = (e->e_id == NULL);
  1324.   
  1325.       /* if newid, queuename will create a locked qf file in e->lockfp */
  1326.       strcpy(tf, queuename(e, 't'));
  1327. --- 100,106 ----
  1328.       **  Create control file.
  1329.       */
  1330.   
  1331. !     newid = (e->e_id == NULL) || !bitset(EF_INQUEUE, e->e_flags);
  1332.   
  1333.       /* if newid, queuename will create a locked qf file in e->lockfp */
  1334.       strcpy(tf, queuename(e, 't'));
  1335. ***************
  1336. *** 109,120 ****
  1337.           newid = FALSE;
  1338.   
  1339.       /* if newid, just write the qf file directly (instead of tf file) */
  1340. !     if (newid)
  1341.       {
  1342. -         tfp = e->e_lockfp;
  1343. -     }
  1344. -     else
  1345. -     {
  1346.           /* get a locked tf file */
  1347.           for (i = 0; i < 128; i++)
  1348.           {
  1349. --- 109,116 ----
  1350.           newid = FALSE;
  1351.   
  1352.       /* if newid, just write the qf file directly (instead of tf file) */
  1353. !     if (!newid)
  1354.       {
  1355.           /* get a locked tf file */
  1356.           for (i = 0; i < 128; i++)
  1357.           {
  1358. ***************
  1359. *** 149,162 ****
  1360.               else
  1361.                   sleep(i % 32);
  1362.           }
  1363. !         if (fd < 0)
  1364. !             syserr("!queueup: cannot create temp file %s", tf);
  1365. !         tfp = fdopen(fd, "w");
  1366.       }
  1367.   
  1368.       if (tTd(40, 1))
  1369. !         printf("\n>>>>> queueing %s >>>>>\n", e->e_id);
  1370.   
  1371.       /*
  1372.       **  If there is no data file yet, create one.
  1373. --- 145,167 ----
  1374.               else
  1375.                   sleep(i % 32);
  1376.           }
  1377. !         if (fd < 0 || (tfp = fdopen(fd, "w")) == NULL)
  1378. !             syserr("!queueup: cannot create queue temp file %s", tf);
  1379.       }
  1380.   
  1381.       if (tTd(40, 1))
  1382. !         printf("\n>>>>> queueing %s%s >>>>>\n", e->e_id,
  1383. !             newid ? " (new id)" : "");
  1384. !     if (tTd(40, 9))
  1385. !     {
  1386. !         printf("  tfp=");
  1387. !         dumpfd(fileno(tfp), TRUE, FALSE);
  1388. !         printf("  lockfp=");
  1389. !         if (e->e_lockfp == NULL)
  1390. !             printf("NULL\n");
  1391. !         else
  1392. !             dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
  1393. !     }
  1394.   
  1395.       /*
  1396.       **  If there is no data file yet, create one.
  1397. ***************
  1398. *** 170,178 ****
  1399.           e->e_df = queuename(e, 'd');
  1400.           e->e_df = newstr(e->e_df);
  1401.           fd = open(e->e_df, O_WRONLY|O_CREAT, FileMode);
  1402. !         if (fd < 0)
  1403. !             syserr("!queueup: cannot create %s", e->e_df);
  1404. !         dfp = fdopen(fd, "w");
  1405.           (*e->e_putbody)(dfp, FileMailer, e, NULL);
  1406.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  1407.           e->e_putbody = putbody;
  1408. --- 175,183 ----
  1409.           e->e_df = queuename(e, 'd');
  1410.           e->e_df = newstr(e->e_df);
  1411.           fd = open(e->e_df, O_WRONLY|O_CREAT, FileMode);
  1412. !         if (fd < 0 || (dfp = fdopen(fd, "w")) == NULL)
  1413. !             syserr("!queueup: cannot create data temp file %s",
  1414. !                 e->e_df);
  1415.           (*e->e_putbody)(dfp, FileMailer, e, NULL);
  1416.           (void) xfclose(dfp, "queueup dfp", e->e_id);
  1417.           e->e_putbody = putbody;
  1418. ***************
  1419. *** 267,273 ****
  1420.   
  1421.       bzero((char *) &nullmailer, sizeof nullmailer);
  1422.       nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
  1423. !             nullmailer.m_se_rwset = nullmailer.m_sh_rwset = -1;
  1424.       nullmailer.m_eol = "\n";
  1425.   
  1426.       define('g', "\201f", e);
  1427. --- 272,278 ----
  1428.   
  1429.       bzero((char *) &nullmailer, sizeof nullmailer);
  1430.       nullmailer.m_re_rwset = nullmailer.m_rh_rwset =
  1431. !             nullmailer.m_se_rwset = nullmailer.m_sh_rwset = 0;
  1432.       nullmailer.m_eol = "\n";
  1433.   
  1434.       define('g', "\201f", e);
  1435. ***************
  1436. *** 352,357 ****
  1437. --- 357,363 ----
  1438.       else
  1439.           qf = tf;
  1440.       errno = 0;
  1441. +     e->e_flags |= EF_INQUEUE;
  1442.   
  1443.   # ifdef LOG
  1444.       /* save log info */
  1445. ***************
  1446. *** 868,873 ****
  1447. --- 874,880 ----
  1448.           e->e_flags |= EF_QUEUERUN|EF_GLOBALERRS;
  1449.           e->e_errormode = EM_MAIL;
  1450.           e->e_id = id;
  1451. +         GrabTo = FALSE;
  1452.           if (forkflag)
  1453.           {
  1454.               disconnect(1, e);
  1455. ***************
  1456. *** 1424,1429 ****
  1457. --- 1431,1441 ----
  1458.           define('i', e->e_id, e);
  1459.           if (tTd(7, 1))
  1460.               printf("queuename: assigned id %s, env=%x\n", e->e_id, e);
  1461. +         if (tTd(7, 9))
  1462. +         {
  1463. +             printf("  lockfd=");
  1464. +             dumpfd(fileno(e->e_lockfp), TRUE, FALSE);
  1465. +         }
  1466.   # ifdef LOG
  1467.           if (LogLevel > 93)
  1468.               syslog(LOG_DEBUG, "%s: assigned id", e->e_id);
  1469. *** src/savemail.c.OLD    Sun Oct 17 11:18:51 1993
  1470. --- src/savemail.c    Thu Oct 21 12:24:51 1993
  1471. ***************
  1472. *** 33,39 ****
  1473.    */
  1474.   
  1475.   #ifndef lint
  1476. ! static char sccsid[] = "@(#)savemail.c    8.14 (Berkeley) 10/15/93";
  1477.   #endif /* not lint */
  1478.   
  1479.   # include "sendmail.h"
  1480. --- 33,39 ----
  1481.    */
  1482.   
  1483.   #ifndef lint
  1484. ! static char sccsid[] = "@(#)savemail.c    8.16 (Berkeley) 10/21/93";
  1485.   #endif /* not lint */
  1486.   
  1487.   # include "sendmail.h"
  1488. ***************
  1489. *** 96,103 ****
  1490.           return;
  1491.       }
  1492.   
  1493. -     e->e_flags &= ~EF_FATALERRS;
  1494.       /*
  1495.       **  In the unhappy event we don't know who to return the mail
  1496.       **  to, make someone up.
  1497. --- 96,101 ----
  1498. ***************
  1499. *** 479,485 ****
  1500.       ee->e_msgsize = ERRORFUDGE;
  1501.       if (!NoReturn)
  1502.           ee->e_msgsize += e->e_msgsize;
  1503. !     openxscript(ee);
  1504.       for (q = returnq; q != NULL; q = q->q_next)
  1505.       {
  1506.           if (bitset(QBADADDR, q->q_flags))
  1507. --- 477,483 ----
  1508.       ee->e_msgsize = ERRORFUDGE;
  1509.       if (!NoReturn)
  1510.           ee->e_msgsize += e->e_msgsize;
  1511. !     initsys(ee);
  1512.       for (q = returnq; q != NULL; q = q->q_next)
  1513.       {
  1514.           if (bitset(QBADADDR, q->q_flags))
  1515. ***************
  1516. *** 601,607 ****
  1517.       for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
  1518.           if (bitset(QBADADDR, q->q_flags))
  1519.               break;
  1520. !     if (q == NULL)
  1521.       {
  1522.           putline("    **********************************************",
  1523.               fp, m);
  1524. --- 599,605 ----
  1525.       for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
  1526.           if (bitset(QBADADDR, q->q_flags))
  1527.               break;
  1528. !     if (q == NULL && !bitset(EF_FATALERRS, e->e_parent->e_flags))
  1529.       {
  1530.           putline("    **********************************************",
  1531.               fp, m);
  1532. No differences encountered
  1533. *** src/usersmtp.c.OLD    Wed Oct 20 09:55:57 1993
  1534. --- src/usersmtp.c    Sun Oct 24 07:44:14 1993
  1535. ***************
  1536. *** 36,44 ****
  1537.   
  1538.   #ifndef lint
  1539.   #ifdef SMTP
  1540. ! static char sccsid[] = "@(#)usersmtp.c    8.11 (Berkeley) 10/15/93 (with SMTP)";
  1541.   #else
  1542. ! static char sccsid[] = "@(#)usersmtp.c    8.11 (Berkeley) 10/15/93 (without SMTP)";
  1543.   #endif
  1544.   #endif /* not lint */
  1545.   
  1546. --- 36,44 ----
  1547.   
  1548.   #ifndef lint
  1549.   #ifdef SMTP
  1550. ! static char sccsid[] = "@(#)usersmtp.c    8.13 (Berkeley) 10/24/93 (with SMTP)";
  1551.   #else
  1552. ! static char sccsid[] = "@(#)usersmtp.c    8.13 (Berkeley) 10/24/93 (without SMTP)";
  1553.   #endif
  1554.   #endif /* not lint */
  1555.   
  1556. ***************
  1557. *** 96,102 ****
  1558.       if (tTd(18, 1))
  1559.       {
  1560.           printf("smtpinit ");
  1561. !         mci_dump(mci);
  1562.       }
  1563.   
  1564.       /*
  1565. --- 96,102 ----
  1566.       if (tTd(18, 1))
  1567.       {
  1568.           printf("smtpinit ");
  1569. !         mci_dump(mci, FALSE);
  1570.       }
  1571.   
  1572.       /*
  1573. ***************
  1574. *** 141,148 ****
  1575.       SmtpPhase = mci->mci_phase = "client greeting";
  1576.       setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
  1577.       r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check);
  1578. !     if (r < 0 || REPLYTYPE(r) != 2)
  1579.           goto tempfail1;
  1580.   
  1581.       /*
  1582.       **  Send the HELO command.
  1583. --- 141,150 ----
  1584.       SmtpPhase = mci->mci_phase = "client greeting";
  1585.       setproctitle("%s %s: %s", e->e_id, CurHostName, mci->mci_phase);
  1586.       r = reply(m, mci, e, TimeOuts.to_initial, esmtp_check);
  1587. !     if (r < 0 || REPLYTYPE(r) == 4)
  1588.           goto tempfail1;
  1589. +     if (REPLYTYPE(r) != 2)
  1590. +         goto unavailable;
  1591.   
  1592.       /*
  1593.       **  Send the HELO command.
  1594. *** src/util.c.OLD    Sun Oct 17 07:12:08 1993
  1595. --- src/util.c    Sat Oct 23 12:45:37 1993
  1596. ***************
  1597. *** 33,39 ****
  1598.    */
  1599.   
  1600.   #ifndef lint
  1601. ! static char sccsid[] = "@(#)util.c    8.11 (Berkeley) 9/22/93";
  1602.   #endif /* not lint */
  1603.   
  1604.   # include "sendmail.h"
  1605. --- 33,39 ----
  1606.    */
  1607.   
  1608.   #ifndef lint
  1609. ! static char sccsid[] = "@(#)util.c    8.14 (Berkeley) 10/23/93";
  1610.   #endif /* not lint */
  1611.   
  1612.   # include "sendmail.h"
  1613. ***************
  1614. *** 1155,1161 ****
  1615.   
  1616.       for (i = 0; i < 3; i++)
  1617.       {
  1618. !         if (fstat(i, &stbuf) < 0)
  1619.           {
  1620.               /* oops.... */
  1621.               int fd;
  1622. --- 1155,1161 ----
  1623.   
  1624.       for (i = 0; i < 3; i++)
  1625.       {
  1626. !         if (fstat(i, &stbuf) < 0 && errno != EOPNOTSUPP)
  1627.           {
  1628.               /* oops.... */
  1629.               int fd;
  1630. ***************
  1631. *** 1170,1173 ****
  1632. --- 1170,1293 ----
  1633.           }
  1634.       }
  1635.   #endif /* XDEBUG */
  1636. + }
  1637. +  /*
  1638. + **  PRINTOPENFDS -- print the open file descriptors (for debugging)
  1639. + **
  1640. + **    Parameters:
  1641. + **        logit -- if set, send output to syslog; otherwise
  1642. + **            print for debugging.
  1643. + **
  1644. + **    Returns:
  1645. + **        none.
  1646. + */
  1647. + #include <netdb.h>
  1648. + #include <arpa/inet.h>
  1649. + printopenfds(logit)
  1650. +     bool logit;
  1651. + {
  1652. +     register int fd;
  1653. +     extern int DtableSize;
  1654. +     for (fd = 0; fd < DtableSize; fd++)
  1655. +         dumpfd(fd, FALSE, logit);
  1656. + }
  1657. +  /*
  1658. + **  DUMPFD -- dump a file descriptor
  1659. + **
  1660. + **    Parameters:
  1661. + **        fd -- the file descriptor to dump.
  1662. + **        printclosed -- if set, print a notification even if
  1663. + **            it is closed; otherwise print nothing.
  1664. + **        logit -- if set, send output to syslog instead of stdout.
  1665. + */
  1666. + dumpfd(fd, printclosed, logit)
  1667. +     int fd;
  1668. +     bool printclosed;
  1669. +     bool logit;
  1670. + {
  1671. +     register struct hostent *hp;
  1672. +     register char *p;
  1673. +     struct sockaddr_in sin;
  1674. +     auto int slen;
  1675. +     struct stat st;
  1676. +     char buf[200];
  1677. +     p = buf;
  1678. +     sprintf(p, "%3d: ", fd);
  1679. +     p += strlen(p);
  1680. +     if (fstat(fd, &st) < 0)
  1681. +     {
  1682. +         if (printclosed || errno != EBADF)
  1683. +         {
  1684. +             sprintf(p, "CANNOT STAT (%s)", errstring(errno));
  1685. +             goto printit;
  1686. +         }
  1687. +         return;
  1688. +     }
  1689. +     slen = fcntl(fd, F_GETFL, NULL);
  1690. +     if (slen != -1)
  1691. +     {
  1692. +         sprintf(p, "fl=0x%x, ", slen);
  1693. +         p += strlen(p);
  1694. +     }
  1695. +     sprintf(p, "mode=%o: ", st.st_mode);
  1696. +     p += strlen(p);
  1697. +     switch (st.st_mode & S_IFMT)
  1698. +     {
  1699. +       case S_IFSOCK:
  1700. +         sprintf(p, "SOCK ");
  1701. +         p += strlen(p);
  1702. +         slen = sizeof sin;
  1703. +         if (getsockname(fd, (struct sockaddr *) &sin, &slen) < 0)
  1704. +             sprintf(p, "(badsock)");
  1705. +         else
  1706. +         {
  1707. +             hp = gethostbyaddr((char *) &sin.sin_addr, slen, AF_INET);
  1708. +             sprintf(p, "%s/%d", hp == NULL ? inet_ntoa(sin.sin_addr)
  1709. +                            : hp->h_name, ntohs(sin.sin_port));
  1710. +         }
  1711. +         p += strlen(p);
  1712. +         sprintf(p, "->");
  1713. +         p += strlen(p);
  1714. +         slen = sizeof sin;
  1715. +         if (getpeername(fd, (struct sockaddr *) &sin, &slen) < 0)
  1716. +             sprintf(p, "(badsock)");
  1717. +         else
  1718. +         {
  1719. +             hp = gethostbyaddr((char *) &sin.sin_addr, slen, AF_INET);
  1720. +             sprintf(p, "%s/%d", hp == NULL ? inet_ntoa(sin.sin_addr)
  1721. +                            : hp->h_name, ntohs(sin.sin_port));
  1722. +         }
  1723. +         break;
  1724. +       case S_IFCHR:
  1725. +         sprintf(p, "CHR: ");
  1726. +         p += strlen(p);
  1727. +         goto defprint;
  1728. +       case S_IFBLK:
  1729. +         sprintf(p, "BLK: ");
  1730. +         p += strlen(p);
  1731. +         goto defprint;
  1732. +       default:
  1733. + defprint:
  1734. +         sprintf(p, "dev=%d/%d, ino=%d, nlink=%d, u/gid=%d/%d, size=%ld",
  1735. +             major(st.st_dev), minor(st.st_dev), st.st_ino,
  1736. +             st.st_nlink, st.st_uid, st.st_gid, st.st_size);
  1737. +         break;
  1738. +     }
  1739. + printit:
  1740. +     if (logit)
  1741. +         syslog(LOG_INFO, "%s", buf);
  1742. +     else
  1743. +         printf("%s\n", buf);
  1744.   }
  1745. *** src/version.c.OLD    Sat Oct 23 12:50:19 1993
  1746. --- src/version.c    Sun Oct 24 10:39:25 1993
  1747. ***************
  1748. *** 33,39 ****
  1749.    */
  1750.   
  1751.   #ifndef lint
  1752. ! static char sccsid[] = "@(#)version.c    8.6.1.2 (Berkeley) 10/15/93";
  1753.   #endif /* not lint */
  1754.   
  1755. ! char    Version[] = "8.6.2";
  1756. --- 33,39 ----
  1757.    */
  1758.   
  1759.   #ifndef lint
  1760. ! static char sccsid[] = "@(#)version.c    8.6.1.3 (Berkeley) 10/24/93";
  1761.   #endif /* not lint */
  1762.   
  1763. ! char    Version[] = "8.6.3";
  1764. *** cf/cf/mail.cs.mc.OLD    Fri Oct 15 17:58:27 1993
  1765. --- cf/cf/mail.cs.mc    Fri Oct 15 18:18:38 1993
  1766. ***************
  1767. *** 34,42 ****
  1768.   #
  1769.   
  1770.   include(`../m4/cf.m4')
  1771. ! VERSIONID(`@(#)mail.cs.mc    8.2 (Berkeley) 8/12/93')
  1772.   OSTYPE(ultrix4.1)dnl
  1773. ! DOMAIN(cs.hidden)dnl
  1774.   FEATURE(notsticky)dnl
  1775.   MAILER(local)dnl
  1776.   MAILER(smtp)dnl
  1777. --- 34,43 ----
  1778.   #
  1779.   
  1780.   include(`../m4/cf.m4')
  1781. ! VERSIONID(`@(#)mail.cs.mc    8.3 (Berkeley) 10/15/93')
  1782.   OSTYPE(ultrix4.1)dnl
  1783. ! DOMAIN(Berkeley)dnl
  1784. ! MASQUERADE_AS(CS.Berkeley.EDU)dnl
  1785.   FEATURE(notsticky)dnl
  1786.   MAILER(local)dnl
  1787.   MAILER(smtp)dnl
  1788. *** cf/m4/version.m4.OLD    Sat Oct 23 13:47:44 1993
  1789. --- cf/m4/version.m4    Sun Oct 24 10:38:33 1993
  1790. ***************
  1791. *** 32,39 ****
  1792.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1793.   # SUCH DAMAGE.
  1794.   #
  1795. ! VERSIONID(`@(#)version.m4    8.6.1.2 (Berkeley) 10/15/93')
  1796.   #
  1797.   divert(0)
  1798.   # Configuration version number
  1799. ! DZ8.6.2
  1800. --- 32,39 ----
  1801.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1802.   # SUCH DAMAGE.
  1803.   #
  1804. ! VERSIONID(`@(#)version.m4    8.6.1.3 (Berkeley) 10/24/93')
  1805.   #
  1806.   divert(0)
  1807.   # Configuration version number
  1808. ! DZ8.6.3
  1809. *** cf/mailer/local.m4.OLD    Sat Oct 23 14:35:05 1993
  1810. --- cf/mailer/local.m4    Sat Oct 23 17:25:16 1993
  1811. ***************
  1812. *** 44,52 ****
  1813.   ###   Local and Program Mailer specification   ###
  1814.   ##################################################
  1815.   
  1816. ! VERSIONID(`@(#)local.m4    8.4 (Berkeley) 8/8/93')
  1817.   
  1818. ! Mlocal,        P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFM', LOCAL_MAILER_FLAGS), S=10, R=20,
  1819.           A=LOCAL_MAILER_ARGS
  1820.   Mprog,        P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20, D=$z:/,
  1821.           A=LOCAL_SHELL_ARGS
  1822. --- 44,52 ----
  1823.   ###   Local and Program Mailer specification   ###
  1824.   ##################################################
  1825.   
  1826. ! VERSIONID(`@(#)local.m4    8.5 (Berkeley) 10/23/93')
  1827.   
  1828. ! Mlocal,        P=LOCAL_MAILER_PATH, F=CONCAT(`lsDFM', LOCAL_MAILER_FLAGS), S=10, R=20/40,
  1829.           A=LOCAL_MAILER_ARGS
  1830.   Mprog,        P=LOCAL_SHELL_PATH, F=CONCAT(`lsDFM', LOCAL_SHELL_FLAGS), S=10, R=20, D=$z:/,
  1831.           A=LOCAL_SHELL_ARGS
  1832. ***************
  1833. *** 53,58 ****
  1834. --- 53,64 ----
  1835.   
  1836.   S10
  1837.   R<@>            $n            errors to mailer-daemon
  1838. + R$+            $: $>40 $1
  1839. + S20
  1840. + R$+ < @ $* >        $: $1            strip host part
  1841. + S40
  1842.   ifdef(`_ALWAYS_ADD_DOMAIN_',
  1843.   `R$* < @ $* > $*        $@ $1 < @ $2 > $3    already fully qualified
  1844.   R$*            $: $1 @ $M        add local qualification
  1845. *** cf/mailer/smtp.m4.OLD    Sat Oct 23 14:35:12 1993
  1846. --- cf/mailer/smtp.m4    Sat Oct 23 17:23:23 1993
  1847. ***************
  1848. *** 40,85 ****
  1849.   ###   SMTP Mailer specification   ###
  1850.   #####################################
  1851.   
  1852. ! VERSIONID(`@(#)smtp.m4    8.5 (Berkeley) 9/19/93')
  1853.   
  1854. ! Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
  1855.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1856. ! Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11, R=ifdef(`_ALL_MASQUERADE_', `11', `21'), E=\r\n,
  1857.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1858. ! Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11, R=19, E=\r\n,
  1859.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1860.   
  1861.   S11
  1862.   
  1863. ! # do sender/recipient common rewriting
  1864. ! R$+            $: $>19 $1
  1865. ! # if already @ qualified, we are done
  1866.   R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1867.   
  1868. - # do not qualify list:; syntax
  1869. - R$* :; <@>        $@ $1 :;
  1870.   
  1871. ! # unqualified names (e.g., "eric") "come from" $M
  1872. ! R$=E            $@ $1 < @ $j>            show exposed names
  1873. ! R$+            $: $1 < @ $M >            user w/o host
  1874. ! R$+ <@>            $: $1 < @ $j >            in case $M undefined
  1875.   
  1876. - ifdef(`_ALL_MASQUERADE_', `dnl',
  1877. - `S21
  1878.   # do sender/recipient common rewriting
  1879.   R$+            $: $>19 $1
  1880.   
  1881. ! # if already @ qualified, we are done
  1882.   R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1883.   
  1884. - # do not qualify list:; syntax
  1885. - R$* :; <@>        $@ $1 :;
  1886.   
  1887. ! # unqualified names (e.g., "eric") are qualified by local host
  1888. ! R$+            $: $1 < @ $j >')
  1889.   
  1890.   S19
  1891.   
  1892.   # pass <route-addr>s through
  1893. --- 40,101 ----
  1894.   ###   SMTP Mailer specification   ###
  1895.   #####################################
  1896.   
  1897. ! VERSIONID(`@(#)smtp.m4    8.6 (Berkeley) 10/23/93')
  1898.   
  1899. ! Msmtp,        P=[IPC], F=CONCAT(mDFMuX, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1900.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1901. ! Mesmtp,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=ifdef(`_ALL_MASQUERADE_', `11/31', `21'), E=\r\n,
  1902.           ifdef(`_OLD_SENDMAIL_',, `L=990, ')A=IPC $h
  1903. ! Mrelay,        P=[IPC], F=CONCAT(mDFMuXa, SMTP_MAILER_FLAGS), S=11/31, R=19, E=\r\n,
  1904.           ifdef(`_OLD_SENDMAIL_',, `L=2040, ')A=IPC $h
  1905.   
  1906. + #
  1907. + #  envelope sender and masquerading recipient rewriting
  1908. + #
  1909.   S11
  1910. + R$+            $: $>19 $1            sender/recipient common
  1911. + R$* :; <@>        $@ $1 :;            list:; special case
  1912.   
  1913. ! # handle unqualified names
  1914.   R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1915. + R$*            $@ $>29 $1
  1916.   
  1917.   
  1918. ! #
  1919. ! #  header recipient rewriting if not masquerading recipients
  1920. ! #
  1921. ! S21
  1922.   
  1923.   # do sender/recipient common rewriting
  1924.   R$+            $: $>19 $1
  1925.   
  1926. ! # unqualified names (e.g., "eric") are qualified by local host
  1927.   R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1928. + R$+            $: $1 < @ $j >            add local domain
  1929.   
  1930.   
  1931. ! #
  1932. ! #  header sender and masquerading recipient rewriting
  1933. ! #
  1934. ! S31
  1935. ! R$+            $: $>19 $1            sender/recipient common
  1936. ! R$* :; <@>        $@ $1 :;            list:; special case
  1937.   
  1938. + # do special header rewriting
  1939. + R$* <@> $*        $@ $1 <@> $2            pass null host through
  1940. + R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  1941. + R$=E < @ $=w . >    $@ $1 < @ $2 >            exposed user as is
  1942. + R$* < @ $=w . >        $: $1 < @ $M >            masquerade as domain
  1943. + R$* < @ >        $: $1 < @ $j >            in case $M undefined
  1944. + # handle unqualified names
  1945. + R$* < @ $* > $*        $@ $1 < @ $2 > $3        already qualified
  1946. + R$*            $@ $>29 $1
  1947. + #
  1948. + #  common rewriting for all SMTP addresses
  1949. + #
  1950.   S19
  1951.   
  1952.   # pass <route-addr>s through
  1953. ***************
  1954. *** 96,98 ****
  1955. --- 112,123 ----
  1956.       `dnl')
  1957.   ifdef(`_NO_UUCP_', `dnl',
  1958.   `R$+ <@ $+ . UUCP >    $: $2 ! $1 < @ $j >        user@host.UUCP')
  1959. + #
  1960. + #  common sender and masquerading recipient rewriting
  1961. + #
  1962. + S29
  1963. + R$=E            $@ $1 < @ $j>            show exposed names
  1964. + R$+            $: $1 < @ $M >            user w/o host
  1965. + R$+ <@>            $: $1 < @ $j >            in case $M undefined
  1966.